package main

import "fmt"

func main() {
	// 1. 统计3个班成绩情况，每个班有5名同学，求出各个班的平均分，以及所有班级的平均分
	var class1Score int = 0
	var class2Score int = 0
	var class3Score int = 0

	for i := 0; i <= 2; i++ {
		for j := 0; j < 5; j++ {
			if i == 0 {
				var studentScore int
				fmt.Println("请输入学生成绩：")
				fmt.Scanf("%d", &studentScore)
				class1Score += studentScore
			} else if i == 1 {
				var studentScore int
				fmt.Println("请输入学生成绩：")
				fmt.Scanf("%d", &studentScore)
				class2Score += studentScore
			} else {
				var studentScore int
				fmt.Println("请输入学生成绩：")
				fmt.Scanf("%d", &studentScore)
				class3Score += studentScore
			}
		}
	}
	fmt.Println("3个班的平均分分别为：", class1Score/5, class2Score/5, class3Score/5)
	fmt.Println("所有班级的平均分为：", (class1Score+class2Score+class3Score)/3)
}
